home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
COMMUNIC
/
TERMINAL
/
1589.ZIP
/
TERM.H
< prev
next >
Wrap
Text File
|
1989-04-12
|
8KB
|
232 lines
/***********************************************************************
** IDM - ID for Menu commands
** IDS - ID for String table
** IDD - ID for Dialog item
***********************************************************************/
struct relations
{
char identifer[3]; /* Two letter identifer */
char sequence[20]; /* Character sequence */
int length ; /* Number of characters */
int meaning ; /* Meaning of sequence */
} ;
/* this trick allows externs to be put in one place */
#ifndef EXTERN
#define EXTERN extern
extern struct relations emulate[];
extern char LineColCodes[];
#include "termdefs.h"
#else
#include "relate.h"
#endif
/***************************/
/* Dialog box resource ids */
/***************************/
#define TERMINAL 1
#define ABOUTDIALOG 2
#define DESCBOX 3
#define PATHBOX 4
#define CONFIGTERM 5
/* IDM... ID for Menus */
/* IDT... ID for Timers */
/* IDS... ID for Strings */
/* IDD... ID for Dialog Box */
#define IDMFLASH 0
#define IDMCOMMANDS 1
#define IDMABOUT 2
#define IDMDIALOG 13
#define IDMCOLOR 14
#define IDMSAVEWINDOW 16
#define IDMON 20
#define IDMOFF 21
#define IDMCONFIG 22
#define IDMCLEAR 23
#define IDMFILE 24
#define IDMCONNECT 25
#define IDTASYNC 30
#define IDTFLASH 31
/* max number of chars in the associated strings in the rc file */
#define CCHMAXSTRING 50
/****************************************
* String Table definations
****************************************/
#define IDSCONTENT 101
#define IDSCLOSE 102
#define IDSOKCLOSE 103
#define IDSSAVE 104
#define IDSOKSAVE 105
#define IDSASYNC 106
#define IDSOKASYNC 107
#define IDSAPPNAME 108
#define IDSABOUT 109
#define IDSTITLE 110
#define IDSDEFAULT 111
#define IDSWINDOWNAME 112
#define IDSMAINTITLE 113
#define IDSCONFIGPATH 114
#define IDSCAPTURE 115
/****************************************
* Dialog Window Definations
****************************************/
#define IDNULL -1
#define IDDDEFAULTS 101
#define IDDTEXT 102
#define IDDCHECKBOX 103
#define IDDNULL 104
#define IDDRBLEFT 105
#define IDDRBRIGHT 106
#define IDDRBCENTER 107
#define IDDLISTBOX 108
#define IDDSBH 109
#define IDDREQTYPE 110
#define IDDREQSTRG 111
#define IDDIMGLIST 112
#define IDDPATHNAME 113
#define IDDLIST 114
#define IDDPB1 115
#define IDDPB2 116
#define IDDPB3 117
#define IDD300 118
#define IDD1200 119
#define IDD9600 120
#define IDDSMALL 121
#define IDDMED1 122
#define IDDMED2 123
#define IDDLARGE 124
#define IDDCOM1 125
#define IDDCOM2 126
#define IDDCOM3 127
#define IDDCOM4 128
#define IDDFLASH 129
#define IDDBEEP 130
#define IDDDISPLAY 131
#define IDDOPEN 132
/****************************************
* SELECTDLG defines *
****************************************/
#define MSG_BEEP 300 /* action to take when a message is seen while iconic*/
#define MSG_OPEN 301
#define MSG_FLASH 302
#define MSG_DISP 303
/* count of msec for async message box and window flash rate */
#define CMSECASYNC 10000
#define CMSECFLASH 1000
#define ICON_RATE 10000
#define FLASH_RATE 1000
#define OPEN_RATE 1
#define ICON_TIMER 1 /* id of timer used when wind iconic*/
#define OPEN_TIMER 2 /* timer when window is open */
#define FLASH_TIMER 3 /* timer used when icon flashing */
#define IN_QUEUE 1024 /* input and output buffers for the */
#define OUT_QUEUE 1024 /* serial port */
#define MAX_LINES 32 /* maximum no. of lines in terminal */
#define MAX_COLS 100 /* maximum no. of columns in term */
#define NEXT_LINE 156
#define NEXT_CHAR 176
#define DOWN_LINE 177
#define CR 0x0d
#define LF 0x0a
#define BS 0x08
#define ESC 0x1b
/*********************************************************************
** These procedures must be declared FAR, even if this application
** were SMALL model, because they are exported and called by windows.
*********************************************************************/
BOOL FAR PASCAL TermAboutDlg (HWND, unsigned, WORD, LONG);
BOOL FAR PASCAL DescDlg (HWND, unsigned, WORD, LONG);
BOOL FAR PASCAL SelectDlg (HWND, unsigned, WORD, LONG);
long FAR PASCAL TermWndProc (HWND, unsigned, WORD, LONG);
BOOL FAR PASCAL Timer (HWND, unsigned, WORD, LONG);
BOOL FAR PASCAL ConfigTerm (HWND, unsigned, WORD, LONG);
/*********************************************************************
** These procedures are declared here to get type and parameter
** checking for calls between modules. The compiler switches -AS and
** -AM for SMALL and MIDDLE model will make them NEAR and FAR
** respectively, so there is no explicit declaration as NEAR or FAR.
*********************************************************************/
TermCharInput (HWND, int, int);
TermClose (HWND);
TermCreate (HWND);
TermEndSession (HWND, BOOL);
TermEraseBkgnd (HWND, HDC);
TermGetFocus (HWND, HWND);
TermHorzScroll (HWND, int, int);
TermKeyInput (HWND, unsigned, int);
TermLoseFocus (HWND, HWND);
TermMouse (HWND, unsigned, WORD, POINT);
TermMove (HWND, int, int);
TermPaint (HWND);
TermQueryEndSession (HWND);
TermSize (HWND, int, int, int, long);
long TermCommand (HWND, unsigned, WORD, LONG);
long TermSysCommand (HWND, unsigned, WORD, LONG);
TermTimer (HWND, WORD);
TermVertScroll (HWND, int, WORD);
int FAR TermInit (HANDLE, HANDLE, LPSTR, int);
/********************************************************************/
/* GLOBALS */
typedef struct Display
{
HANDLE Handle ;
char *string ;
} DISPLAY ;
EXTERN int nCID, Capture, CaptureFD, CaptureLine;
EXTERN short win_size, flashing, message_action, PaintWindow;
EXTERN short width, height, ret;
EXTERN short char_w, char_h;
EXTERN short no_lines, no_cols;
EXTERN short next_line, next_char;
EXTERN short baud_rate, byte_size, parity, stop_bits, open_size, port;
EXTERN short VerboseMessages, LogErrors, GraphicsMode;
EXTERN BOOL TermHasFocus, CaretMode;
EXTERN char port_name[6], ConfigPath[40];
EXTERN char szAppName[20];
EXTERN char buff[512], CaptureBuff[96];
EXTERN DISPLAY display[MAX_LINES];
EXTERN struct window_size win_sz;
EXTERN HBRUSH hbrWhite;
EXTERN HBRUSH hbrBlack;
EXTERN HANDLE hCommHandle;
EXTERN HANDLE hAccelTable;
EXTERN HANDLE hInstTerm;
EXTERN HANDLE hAccelTable;
EXTERN HCURSOR hArrowCurs;
EXTERN HMENU hMenuMain;
EXTERN HFONT IBMfont;
EXTERN HWND hWndTerm;
EXTERN HWND hWdesc;
EXTERN FARPROC lpprocTimer;
EXTERN FARPROC lpprocDescDlg;
EXTERN FARPROC lpprocSelectDlg;
EXTERN FARPROC lpprocConfigTerm;
EXTERN FARPROC lpprocTermAboutDlg;
EXTERN PAINTSTRUCT ps;
EXTERN BOOL fDoFlash;
EXTERN POINT curs_pos; /* current position of cursor */
EXTERN RECT rect;
EXTERN HDC hTermDC;
EXTERN DCB *DCBPtr;
extern short errno;